# -*- coding: utf-8 -*-
"""
    统一 blueprint 蓝图注册文件
    每次 controllers 新建蓝图时，都要来这里注册
"""


"""
引入路由文件
"""
from application import app


"""
统一拦截器
"""
from web.interceptors.AuthInterceptors import * # 通用拦截器
from web.interceptors.ErrorInterceptor import * # 错误拦截器


"""
蓝图功能，对所有的url进行蓝图的功能配置
"""
from web.controllers.index import route_index # 引入首页
from web.controllers.static import route_static # 引入static静态文件
from web.controllers.user.User import route_user # 引入User
from web.controllers.account.Account import route_account # 引入Account
from web.controllers.finance.Finance import route_finance # 引入Finance
from web.controllers.food.Food import route_food # 引入Food
from web.controllers.member.Member import route_member # 引入Food
from web.controllers.stat.Stat import route_stat # 引入Stat

"""
蓝图功能，小程序的API
"""
from web.controllers.api.Api import route_api

# 注册路由
app.register_blueprint(route_index, url_prefix = "/") # 首页
app.register_blueprint(route_static, url_prefix = "/static") # 静态文件(css,img)
app.register_blueprint(route_user, url_prefix = "/user") # 登录/注册
app.register_blueprint(route_account, url_prefix = "/account") # 账户管理
app.register_blueprint(route_finance, url_prefix = "/finance") # 财务管理
app.register_blueprint(route_food, url_prefix = "/food") # 餐饮管理
app.register_blueprint(route_member, url_prefix = "/member") # 会员管理
app.register_blueprint(route_stat, url_prefix = "/stat") # 统计管理

app.register_blueprint(route_api, url_prefix = "/api") # 统计管理
